@extends('admin::layouts.master')
@section('content')
    <div class="col-lg-12">
        <div class="card card-border-color card-border-color-primary">
            <div class="card-header">
                货品操作>>>>【{{$goods['gname']}}的货品】
            </div>
            <div class="card-body">
                <div class="col-lg-12">
                    <div class="card card-table">
                        <div class="card-header">
                            <a href="{{route('goods.index')}}" class="btn btn-space btn-danger">查看商品列表</a>
                            <a href="{{route('shop',$gid)}}" class="btn btn-space btn-primary">货品列表</a>
                            <a href="{{route('shopcreate',$gid)}}" class="btn btn-space btn-success">添加货品</a>
                        </div>
                        <div class="card-body">
                            <table class="table">
                                <thead>
                                <tr>
                                    <th style="">货品编号</th>
                                    <th style="">货品名称</th>
                                    <th style="">货品价格</th>
                                    <th style="">属性组合</th>
                                    <th style="">库存</th>
                                    <th style="">创建时间</th>
                                    <th >操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                    @foreach($shops as $v)
                                    <tr>
                                        <td>{{$v['id']}}</td>
                                        <td>{{$v['sname']}}</td>
                                        <td>{{$v['price']}}</td>
                                        <td>{{$v['attrs']}}</td>
                                        <td>剩余:{{$v['kucun']}}</td>
                                        <td>{{$v['created_at']}}</td>
                                        <td >
                                            <div class="btn-group btn-space">
                                                <a href="{{route('shopedit',[$gid,$v['id']])}}" class="btn btn-space btn-primary">
                                                    编辑
                                                </a>
                                                <form action="{{route('shopdel',$gid)}}" method="post">
                                                    @csrf
                                                    <button type="submit" class="btn btn-space btn-danger">删除</button>
                                                </form>
                                                
                                            </div>
                                        </td>
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection